Why won't typescript allow me to set undefined when it is allowed to set it

welcome to shbcf.ru